<template>
    <van-nav-bar title="分类列表" left-text="返回" left-arrow @click-left="() => { $router.push('/home/fen') }" />
    <div v-for="item in goodsDate">
        <router-link :to="'/detail/' + item.goods_id">
            <van-card :price="item.goods_price" :title="item.goods_name" :thumb="item.goods_big_logo" />
        </router-link>
    </div>


</template>

<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router'
let route = new useRoute()
let router = new useRouter()
console.log(route.params.cat_name)
import { goodsApi } from '@/api/api'
let goodsDate = ref([])
const goods = () => {
    goodsApi(route.params.cat_name).then(res => {
        console.log('列表数据', res)
        goodsDate.value = res.data.message.goods
    })
}
goods()
</script>

<style lang="scss" scoped></style>